import snap
import numpy as np
import pandas as pd


def loadfile():
    edges = pd.read_table("facebook_combined.txt", sep=' ', header=None)
    edges = np.array(edges)
    # print(edges)
    G1 = snap.TUNGraph.New()
    for i in range(4039):
        G1.AddNode(i)
    for edge in edges:
        G1.AddEdge(int(edge[0]), int(edge[1]))

    for NI in G1.Nodes():
        print("node id %d with out-degree %d and in-degree %d" % (
            NI.GetId(), NI.GetOutDeg(), NI.GetInDeg()))
    # for EI in G1.Edges():
    #     print("edge (%d, %d)" % (EI.GetSrcNId(), EI.GetDstNId()))
    # for NI in G1.Nodes():
    #     for Id in NI.GetOutEdges():
    #         print("edge (%d %d)" % (NI.GetId(), Id))


if __name__ == "__main__":
    loadfile()
